<link rel="stylesheet" href="<?php echo base_url(); ?>/documents-dated/css/reset-sambo.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>/css-dated/BeatPicker.min.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>/documents-dated/css/prism-sambo.css"/>
<script src="<?php echo base_url(); ?>/js-dated/jquery-1.11.0.min.js"></script>
<script src="<?php echo base_url(); ?>/js-dated/BeatPicker.min.js"></script>
<script src="<?php echo base_url(); ?>/documents-dated/js/prism-sambo.js"></script>



<?php $this->load->view('admin/header_layout'); ?>
<div class="content-inner">
    <div class="marg20-btm">
        <a href=<?php echo site_url('threads/allthreads'); ?> class="btn btn-primary">&hearts; View All </a>
    </div>
    <form action="<?php echo site_url('threads/update_thread'); ?>" method="post" class="form-horizontal" />


    <?php
    if ($thread_edit->num_rows() > 0) {
        foreach ($thread_edit->result() as $row) {

            $th_title = array(
                'name' => 'title',
                'value' => $row->thread_title,
                'id' => 'input01',
                'required' => '',
                'placeholder' => 'Title...',
                'class' => 'input-xlarge'
            );
            $th_content = array(
                'name' => 'content',
                'value' => $row->thread_content,
                'id' => 'input01',
                'required' => '',
                'placeholder' => 'Content...',
                'class' => 'input-xlarge'
            );
            $th_dated = array(
                'name' => 'dated',
                'value' => $row->thread_dated,
                'id' => 'input01',
                'required' => '',
                'placeholder' => 'Publish Dated...',
                'class' => 'input-xlarge'
            );
            $getid = array(
                'name' => 'getid',
                'value' => $row->thread_id,
                'id' => 'input01',
                'class' => 'input-xlarge',
                'type' => 'hidden'
            );
            $th_status = array(
                '1' => 'Approved',
                '0' => 'Disapproved'
            );
            $th_author = array(
                '1' => 'Administrator',
                '2' => 'Simple User'
            );
        }
    }
    ?>
    <div class="control-group">
        <label class="control-label" for="input01">Title </label>
        <div class="controls">
            <?php echo form_input($th_title); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Content </label>
        <div class="controls">
            <?php echo form_input($th_content); ?>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="input01">Publish Dated </label>
        <div class="controls">
            <input type="text" data-beatpicker="true" name="dated" value="<?php $th_dated; ?>" />
            <?php //echo form_input($th_dated);?>
            <?php echo form_input($getid); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Author </label>
        <div class="controls">
            <?php echo form_dropdown('author', $th_author); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="input01">Status Role </label>
        <div class="controls">
            <?php echo form_dropdown('status', $th_status); ?>
        </div>
    </div>
    <div class="form-actions">
        <button type="submit" class="btn btn-primary">Save </button>
        <a href="" class="btn">Cancel </a>
    </div>
</form> 